home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d12 / debugtx.arc / 08QUEST.DOC < prev    next >
Encoding:
Text File  |  1991-08-11  |  4.3 KB  |  103 lines

  1. CHAPTER 8   COMMONLY ASKED QUESTIONS                          8-1
  2.  
  3. Setting Registers
  4.    
  5. Q: Why isn't there a debugger command to modify register settings?
  6.  
  7. A: You can do so with an immediate assembly language command.  
  8.    For example, to set the AX register to 100 type MOV AX,100 . 
  9.    You can now also set segment registers this way: MOV DS,0  .  
  10.    REMEMBER that if there isn't a leading zero, all constants fed 
  11.    to D86 are assumed to be decimal.  If you want hex constants, 
  12.    supply a leading zero. 
  13.  
  14.  
  15. Q: How do you reset the CS register?  MOV CS,value doesn't work.
  16.  
  17. A: You issue a far JMP instruction to be executed immediately.  
  18.    For example, to set CS to 0 and IP to 400 hex, type JMP 0:0400
  19.    
  20.  
  21.  
  22. Modifying Memory
  23.                 
  24. Q: Why aren't there commands for changing memory to different hex 
  25.    values, or for filling memory with a given value?
  26.    
  27. A: You can do this very effectively with D86's patch memory mode.
  28.    Just issue an immediate JMP to the location you want modified, 
  29.    press the F7 key to enter patch-memory mode, and then issue 
  30.    any A86 directive to initialize memory: DB for bytes, DW for 
  31.    words, DD for doublewords, etc.  Remember, you have the full 
  32.    power of the A86 language at your disposal.  You can provide 
  33.    lists of values on a single line: 
  34.    
  35.    DW 0100,0101,MY_SYMBOL
  36.  
  37.    You can make ASCII initializations with strings on DB lines: 
  38.    
  39.    DB 'This is a string',0D,0A,0
  40.  
  41.    You can use the DUP construct to fill memory with a given 
  42.    value or sequence of values:
  43.    
  44.    DB 100 DUP 0, 10 DUP (1,2,3)           
  45.                                                              8-2
  46. Screen Problems
  47.  
  48. Q: My debugger screen gets corrupted whenever the program being 
  49.    debugged outputs to the console.  What can I do about it?
  50.  
  51. A: This problem exists because D86 cannot quickly refresh the 
  52.    screen on computers using the CGA (Color Graphics Adaptor) 
  53.    video interface, without filling the screen with annoying 
  54.    "snow".  So on a CGA computer D86 tries to keep track of what 
  55.    it has output, and refresh only the parts of the screen that 
  56.    have changed.  The strategy fails if the program itself 
  57.    changes the screen.  You can restore a trashed screen by 
  58.    pressing the Alt-F9 key.
  59.  
  60.    I haven't had the chance yet to implement a more sophisticated 
  61.    screen interface, allowing you to switch between the program's 
  62.    and the debugger's screen.  Until I do, you have these 
  63.    options:
  64.  
  65.    * You can keep pressing Alt-F9 a lot.
  66.  
  67.    * If your program is making simple, teletype-style outputs 
  68.      using MS-DOS function calls, you can redirect standard 
  69.      output to your printer for the debugging session.
  70.  
  71.    * If you're really doing serious development of a heavily-
  72.      video program, you should consider getting a second, 
  73.      monochrome-interface monitor for your computer.  Starting 
  74.      from your CGA display, invoke D86 with the +V option.  D86 
  75.      will come up on your monochrome monitor, but the program's 
  76.      cursor will remain on the CGA monitor.
  77.                                                              8-3
  78. Debugging ROM
  79.  
  80. Q: I tried stepping into a ROM BIOS routine.  It worked for a 
  81.    while, but when I got to a certain instruction and stepped, 
  82.    the computer crashed.  What's wrong? 
  83.  
  84. A: My official policy on stepping into ROM is, "all bets are 
  85.    off".  D86 does better than many debuggers at stepping into 
  86.    ROM, but there are still some fairly insurmountable problems.  
  87.    First, D86 itself calls the BIOS.  Not all BIOS routines are 
  88.    reentrant; you could get unfortunate interactions between the 
  89.    call being stepped and calls made by D86 while you are 
  90.    stepping.  Second, ROM cannot be modified and hence traps 
  91.    cannot be set within ROM.  D86 doesn't try to detect failed 
  92.    trap-setting, so the program may be set loose in situations 
  93.    where D86 thinks (and you think) it will retain control.
  94.  
  95.    This will always happen if you try the F2 key in ROM.  It will 
  96.    also happen if you try to use the F1 key on an instruction that 
  97.    loads a segment register.  For arcane reasons, the single-
  98.    stepping feature built into the 8088 doesn't work on such 
  99.    instructions, so D86 must single-step them with a trap.  Thus, 
  100.    F1 on a segment-loading instruction in ROM will set the 
  101.    program loose.
  102.  
  103.